import RequestHttp from '@/api'
import type { Login, TestList } from '@/api/interface/demo'

class DemoService {
  private http
  constructor() {
    this.http = new RequestHttp({
      baseURL: import.meta.env.VITE_API_URL as string
    })
  }

  /**
   * 企业WEB登陆
   */
  login = (phone: string, passWord: string) => {
    return this.http.postForm<Login.ResLogin>('/auth/v1/enterprise/web/login', { phone, passWord })
  }
  /**
   * 测试列表
   */
  getVehicleList = (params: TestList.ReqParams) => {
    return this.http.post<TestList.ResItem[]>(
      '/enterprise/vehicle/v1/get_enterprise_vehicles',
      params
    )
  }
}

export default new DemoService()
